<include file="Public/base"/>
<!--表单-->
<div class="pd-20">
	<!-- 修改密码表单 -->
	<form id='myForm' class="form form-horizontal">
		<input type="hidden" name="id" value="{$id}">
		<div class="row cl">
			<label class="form-label col-3">新密码：</label>
			<div class="formControls col-5">
				<input type="text" name="password" id="password" class="input-text" autocomplete="off" />
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">确认密码：</label>
			<div class="formControls col-5">
				<input type="text" name="repassword" id="repassword" class="input-text" autocomplete="off" />
			</div>
		</div>
	</form>
		<div class="row cl">
			<div class="col-9 col-offset-3">
				<button type="submit"  id="submit" class="btn btn-primary radiusn" target-form="form-horizontal">确 认</button>
				<button class="btn btn-warning radius" onclick="history.back(-1);return false;">返 回</button>
			</div>
		</div>
</div>
<script type="text/javascript" src="__STATIC__/common/js/func.js"></script>
<script type="text/javascript">
	$(function(){
		//提交
		var issend = false;
		$('#submit').click(function(){
			var password = $.trim($('#password').val());
			var repassword = $.trim($('#repassword').val());
			if(!password || !repassword){
				layer_error('请输入密码');
				return false;
			}
			if(password.length>16 || password.length<6){
				layer_error('密码长度为6~16位');
				return false;
			}
			if(password!=repassword){
				layer_error('两次密码不一致');
				return false;
			}
			if(issend) return false;
			issend = true;
			//提交数据
			var data = $('#myForm').serialize();
			$.post(location.href,data,function(mydata){
				issend = false;
				if(mydata.code==0){
					layer_success('修改成功',2000,function(){
						parent.layer.closeAll();
					});
				}else{
					layer_error(mydata.msg);
				}
			},'json');
		});
	});
</script>